<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Bom对象</title>
    <script>
        var b = confirm('欲练此功，必先自宫')
        if(b){
            alert('若不自宫，也可成功')
        }else{
            alert('若是自宫，未必成功')
        }
        window.onload = function(){
            var obj = document.getElementById('d1')
            console.log(obj.innerHTML)
        }
    </script>
</head>
<body>
    <div id="d1">
        上课
    </div>
</body>
</html>